/*
 *  Copyright (c) 2022 Kirky
 *
 * Licensed under the Open Software Licence, Version 3.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://opensource.org/licenses/osl-3.0.php
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.lingeringdream.luciole.model;

/**
 * api常量
 *
 * @author Kirky
 * @version 1.0
 * @date 2022/5/5
 */
public enum ApiConstants {
    /**
     * UAA配置
     */
    CLIENT_ID("luciole"),
    CLIENT_SECRET("tsingying"),
    GRANT_PASSWORD("password"),
    GRANT_HUAWEI("hw_authorization_code"),
    GRANT_CREDENTIALS("client_credentials"),

    /**
     * 账户
     */
    LOGIN("/uaa/oauth/token"),
    LOGOUT("/logout"),
    USER_REGISTER("/register"),
    USER_CANCEL("/api/account/user/cancel"),
    USER_QUERY("/api/account/user/query"),
    MODIFY_PASSWORD("/api/account/user/modify/psw"),
    MODIFY_TEL("/api/account/user/modify/tel"),
    MODIFY_INFO("/api/account/user/modify/info"),
    /**
     * 头像
     */
    UPLOAD_AVATAR("/api/avatars/upload"),
    DOWNLOAD_AVATAR("/api/avatars/download"),

    /**
     * 华为账户
     */
    HUAWEI_LOGOUT("/huawei/logout");

    private final String api;

    ApiConstants(String api) {
        this.api = api;
    }

    public String getApi() {
        String root = "http://api.luciole.com";
        return root + api;
    }

    public String getContain() {
        return api;
    }
}
